package org.example.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import java.io.Serializable;
import java.time.LocalDate;
import java.time.LocalDateTime;


@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("tb_house_order")
public class HouseOrder implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * 主键
     */
    @TableId(value = "id", type = IdType.INPUT)
    @JsonSerialize(using= ToStringSerializer.class)
    private Long id;

    /**
     * 下单的用户id
     */
    private Long userId;

    /**
     * 出租屋id
     */
    private Long houseId;

    /**
     * 支付方式 1：信用额度支付；2：支付宝；3：微信
     */
    private Integer payType;

    /**
     * 订单状态，1：未支付；2：已支付；3：已核销；4：已取消；5：退款中；6：已退款
     */
    private Integer status;

    /**
     * 下单时间
     */
    private LocalDateTime createTime;

    /**
     * 退款时间
     */
    private LocalDateTime refundTime;

    private LocalDate checkinDate;

    private LocalDate checkoutDate;

    private Integer amount;

    private Long total;

    private Long currentPrice;

    @TableField(exist = false)
    private Long originalPrice;

    @TableField(exist = false)
    private String title;

    @TableField(exist = false)
    private String images;
}
